home *** CD-ROM | disk | FTP | other *** search
/ CD ROM Paradise Collection 4 / CD ROM Paradise Collection 4 1995 Nov.iso / graphics / vlapak1.zip / VERTSCR.ZIP / VSCR3.ASM < prev    next >
Assembly Source File  |  1993-07-24  |  5KB  |  259 lines

  1. ;                         Written By Draeden of VLA    
  2. ────────────────────────────────────────────────────────────────────────────
  3.     IDEAL
  4.     DOSSEG
  5.     MODEL SMALL
  6.     STACK 400h
  7.     CODESEG
  8.     P386
  9. ────────────────────────────────────────────────────────────────────────────
  10. INCLUDE "modex.inc"
  11.  
  12. MaxColor    =   150
  13.  
  14. INCLUDE "MXfont2.INC"
  15. SCRW = 80
  16. TxtHeight   =   8*4
  17.  
  18. NewLineData =   65535/SCRW - TxtHeight      ;where the next line is put (#)
  19. NewLineOff  =   NewLineData*SCRW
  20.  
  21. CurOff      dw  0                               ;current starting offset
  22. MaxOff      =   MaxColor*SCRW
  23.  
  24. CurCopy     dw  0
  25. MaxCopy     =   TxtHeight * SCRW
  26.  
  27. CurLine     db  1       ;from 1 to MaxColor
  28.  
  29. NUMPAL      =   15
  30. CHG         =   3
  31.  
  32. LABEL TopPal BYTE     
  33.     i= 0
  34.     REPT NUMPAL+1
  35.         db  i,i/3,i/2
  36.         i=i+CHG
  37.     ENDM
  38.  
  39. LABEL BotPal BYTE     
  40.     REPT NUMPAL+1
  41.         db  i,i/3,i/2
  42.         i=i-CHG
  43.     ENDM
  44. ────────────────────────────────────────────────────────────────────────────
  45. Msg1        db  "│This #1 │",0
  46. Msg2        db  "│Test #2 │",0
  47. Msg3        db  "│Test #3 │",0
  48. Msg4        db  "│Blah #4 │",0
  49. Msg5        db  "│NYUK #5 │",0
  50. Msg6        db  "│Test #6 │",0
  51. Msg7        db  "│Ug.  #7 │",0
  52.  
  53. NumMsgs     =   7
  54.  
  55. MsgOffs     dw  offset Msg1, offset Msg2, offset Msg3, offset Msg4
  56.             dw  offset Msg5, offset Msg6, offset Msg7
  57. CurMsg      dw  0
  58.  
  59. TitleMsg    db  1,BLUE,"This was coded by ",1,RED,"Draeden",1,BLUE," of ",1,RED,"VLA",0
  60. ────────────────────────────────────────────────────────────────────────────
  61. PROC WritePaletteBars
  62.     pusha
  63.     push    ds
  64.     mov     ax,cs
  65.     mov     ds,ax
  66.  
  67.     cld
  68.  
  69.     mov     si,offset TopPal
  70.     movzx   ax,[CurLine]
  71.     mov     dx,03c8h
  72.     out     dx,al
  73.     inc     dx
  74.     mov     cx,NUMPAL*3
  75.  
  76.     cmp     al,MaxColor+1-NUMPAL
  77.     jbe     @@OkTop
  78.     mov     bx,ax
  79.     sub     bx,MaxColor+1-NUMPAL
  80.     imul    bx,3
  81.     sub     cx,bx
  82.     rep outsb
  83.  
  84.     mov     cx,bx
  85.     mov     al,1
  86.     dec     dx
  87.     out     dx,al
  88.     inc     dx
  89. @@OkTop:
  90.     rep outsb
  91.  
  92.     mov     si,offset BotPal
  93.     movzx   ax,[CurLine]
  94.     add     ax,MaxColor-1-NUMPAL+1
  95.     cmp     ax,MaxColor+1
  96.     jb      @@ok
  97.     sub     ax,MaxColor-1+1
  98. @@Ok:
  99.     mov     dx,03c8h
  100.     out     dx,al
  101.     inc     dx
  102.     mov     cx,NUMPAL*3
  103.  
  104.     cmp     al,MaxColor+1-NUMPAL
  105.     jbe     @@OkBot
  106.     mov     bx,ax
  107.     sub     bx,MaxColor+1-NUMPAL
  108.     imul    bx,3
  109.     sub     cx,bx
  110.     rep outsb
  111.  
  112.     mov     cx,bx
  113.     mov     al,1
  114.     dec     dx
  115.     out     dx,al
  116.     inc     dx
  117. @@OkBot:
  118.     rep outsb
  119.  
  120.     pop     ds
  121.     popa
  122.     ret
  123. ENDP
  124.  
  125. PROC ScrollDown
  126.     pusha
  127.     push    es ds
  128.     mov     es,[cs:VGAseg]
  129.     mov     ds,[cs:VGAseg]
  130.  
  131.     mov     ah,1
  132.     @Set_Write_Mode
  133.     mov     ah,1111b
  134.     @Set_Write_Plane
  135.  
  136.     inc     [cs:CurLine]
  137.     cmp     [cs:CurLine],MaxColor
  138.     jbe     @@ok
  139.     mov     [cs:CurLine],1
  140. @@Ok:
  141.  
  142.     mov     di,[cs:CurOff]
  143.     mov     bx,di
  144.     add     bx,SCRW
  145.     cmp     bx,MAXOFF
  146.     jb      @@COOK
  147.     xor     bx,bx
  148. @@COOK:
  149.     mov     [cs:CurOff],bx
  150.     add     di,(240-MaxColor)*SCRW
  151.     add     bx,(240-MaxColor)*SCRW
  152.     
  153.     @Set_Start_Offset
  154.     
  155.     @WaitVert
  156.     call    WritePaletteBars
  157.     @WaitVertEnd
  158.     ;@FullVertWait
  159.  
  160.     push    di
  161.  
  162.     mov     si,NewLineOff
  163.     add     si,[cs:CurCopy]
  164.     push    si
  165.     mov     cx,80
  166.     rep movsb
  167.     
  168.     pop     si
  169.     pop     di
  170.  
  171.     add     di,MaxColor*SCRW
  172.     mov     cx,80
  173.     rep movsb
  174.  
  175.     mov     ax,[cs:CurCopy]
  176.     add     ax,SCRW
  177.     cmp     ax,MaxCopy
  178.     jb      @@Cok
  179.     call    PutNextMsg
  180.     xor     ax,ax
  181. @@Cok:
  182.     mov     [cs:CurCopy],ax
  183.  
  184.     pop     ds es
  185.     popa
  186.     ret
  187. ENDP
  188.     ;es = VGAseg
  189. PROC PutNextMsg
  190.     pusha
  191.     push    ds
  192.     mov     ax,cs
  193.     mov     ds,ax
  194.  
  195.     mov     ah,1111b
  196.     @Set_Write_plane
  197.     mov     di,NewLineOff
  198.     xor     ax,ax
  199.     mov     cx,SCRW*TxtHeight
  200.     rep stosb
  201.     
  202.     mov     ah,0
  203.     @Set_Write_Mode
  204.     
  205.     mov     di,NewLineData
  206.     xor     ax,ax
  207.     mov     si,[CurMsg]
  208.     mov     si,[si + MsgOffs]
  209.     mov     cl,[CurLine]
  210.     call    PrintShadeTextBIG
  211.  
  212.     add     [CurMsg],2
  213.     cmp     [CurMsg],NumMsgs*2
  214.     jb      @@noResetMsg
  215.     mov     [CurMsg],0
  216. @@noResetMsg:
  217.     pop     ds
  218.     popa
  219.     ret
  220. ENDP
  221. ────────────────────────────────────────────────────────────────────────────
  222. START:
  223.     mov     ax,cs
  224.     mov     ds,ax
  225.     mov     es,ax
  226.  
  227.     call    StealFont
  228.  
  229.     @SetModeX m320x240x256, 320
  230.  
  231.     mov     bx,MaxColor * 2
  232.     @Set_Split
  233.  
  234.     call    SetDefPal
  235.  
  236.     mov     cl,MaxColor + 1
  237.     mov     si,offset TitleMsg
  238.     mov     di, 0
  239.     mov     ax, 0
  240.     call    PrintText
  241.  
  242. @@MainLoop:
  243.     call    ScrollDown
  244.  
  245.     mov     ah,1
  246.     int     16h
  247.     jz      @@MainLoop
  248.  
  249.     mov     ah,0
  250.     int     16h
  251.  
  252.     mov     ax,3
  253.     int     10h
  254.  
  255.     mov     ax,4c00h
  256.     int     21h
  257. END START
  258.  
  259.